<template>
  <div class="app-container">
    <el-button @click="editDomain">设置服务器域名</el-button>
    <el-dialog title="设置服务器域名" :visible.sync="Domainopen" width="900px" append-to-body>
      <el-button @click="addDomain">添加服务器域名</el-button>
      <el-button @click="deleteDomain">删除服务器域名</el-button>
      <el-button @click="setDomain">覆盖服务器域名</el-button>
      <el-button @click="getDomain">获取服务器域名</el-button>
      <div slot="footer" class="dialog-footer">
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
    <el-button @click="setwebviewdomainopen">设置业务域名</el-button>
    <el-dialog title="设置业务域名" :visible.sync="webviewdomainOpen" width="900px" append-to-body>
      <el-button @click="addwebviewdomain">添加业务域名</el-button>
      <el-button @click="deletewebviewdomain">删除业务域名</el-button>
      <el-button @click="setwebviewdomain">覆盖业务域名</el-button>
      <el-button @click="getwebviewdomain">获取业务域名</el-button>
      <div slot="footer" class="dialog-footer">
        <el-button @click="webviewdomaincancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import {modifyDomain,webviewdomain} from "@/api/applet/authorization";

export default {
  name: "Info",
  components: {

  },
  data() {
    return {
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      Domainopen: false,
      webviewdomainOpen:false,
      // 表单参数
      form: {}
    };
  },
  created() {

  },
  methods: {
    //设置服务器域名
    editDomain(){
      this.Domainopen = true;
    },
    //添加服务器域名
    addDomain(){
      let action = "add";
      modifyDomain(action).then(response => {
        console.log("成功添加服务器域名"+response)
      })
    },
    //删除服务器域名
    deleteDomain(){
      let action = "delete";
      modifyDomain(action).then(response => {
        console.log("成功删除服务器域名"+response)
      })
    },
    //覆盖服务器域名
    setDomain(){
      let action = "set";
      modifyDomain(action).then(response => {
        console.log("成功覆盖服务器域名"+response)
      })
    },
    //覆盖服务器域名
    getDomain(){
      let action = "get";
      modifyDomain(action).then(response => {
        console.log("成功获取服务器域名"+response)
      })
    },




    setwebviewdomainopen(){
      this.webviewdomainOpen = true;
    },
    //添加业务域名
    addwebviewdomain(){
      let action = "add";
      webviewdomain(action).then(response => {
        console.log("成功添加业务域名"+response)
      })
    },
    //删除业务域名
    deletewebviewdomain(){
      let action = "delete";
      webviewdomain(action).then(response => {
        console.log("成功删除业务域名"+response)
      })
    },
    //覆盖业务域名
    setwebviewdomain(){
      let action = "set";
      webviewdomain(action).then(response => {
        console.log("成功覆盖业务域名"+response)
      })
    },
    //获取业务域名
    getwebviewdomain(){
      let action = "get";
      webviewdomain(action).then(response => {
        console.log("成功获取业务域名"+response)
      })
    },
    // 取消按钮
    cancel() {
      this.Domainopen = false;
    },
    webviewdomaincancel() {
      this.webviewdomainOpen = false;
    },
  }
};
</script>
